package com.baosight.sczx.zm.cp.service;

import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.threadlocal.UserSession;
import com.baosight.iplat4j.ep.ServiceEPBase;
import com.baosight.sczx.common.zm.basetools.StaticTools;
import com.baosight.sczx.zm.cp.domain.ZMCPProducePlan;

/**
 * 生产计划主表操作
 * @author wealupa
 * By.严洪浩
 */
public class ServiceZMCP20 extends ServiceEPBase {

	/**
	 * 进入时初始化
	 */
	@Override
	public EiInfo initLoad(EiInfo inInfo) {
		inInfo.addBlock(EiConstant.resultBlock).set("showCount", "true");//如果不加这个，翻页的统计和显示是错误的
		EiInfo outInfo = this.query(inInfo);		
		return outInfo;
	}
	
	/**
	 *  查询
	 * <p>Function: query</p> 
	 */
	@Override
	public EiInfo query(EiInfo inInfo) {
		String fdPlanYear = inInfo.getString("_planYear");
		String fdPlanMonth = inInfo.getString("_planMonth");
		StaticTools.setQueryParameters(inInfo, "fdPlanYear", fdPlanYear, true);
		StaticTools.setQueryParameters(inInfo, "fdPlanMonth", fdPlanMonth, true);
		StaticTools.setQueryParameters(inInfo, "fdMiningId", UserSession.getInSessionProperty("miningCode"), true);
		EiInfo outInfo = super.query(inInfo, "ZMCPProducePlan.query", new ZMCPProducePlan());
		return outInfo;
	}
	
}
